<template>
  <section class="GeneralDoc">
    <xny-vxe-table
      :option="tableOption"
      :column="addIndex(tableColumn)"
      :data="tableData"
    />
  </section>
</template>

<script>
import tableData from './tableData'
export default {
  name: 'GeneralDoc',
  data() {
    return {
      tableOption: {
        menu: false,
        stripe: false,
        isCurrent: true,
        height: 'none',
        align: 'left',
      },
      tableColumn: [
        {
          label: '名称',
          prop: 'name',
        },
        {
          label: '说明',
          prop: 'explain',
        },
        {
          label: '类型/参数类型',
          prop: 'type',
        },
        {
          label: '可选值',
          prop: 'option',
          width: 80,
        },
        {
          label: '默认值/参数',
          prop: 'defaultOrParam',
        },
      ],
      tableData,
    }
  },
  props: {},
  components: {},
  watch: {},
  computed: {},
  methods: {
    addIndex(arr) {
      arr.forEach((item, index) => (item.index = index))
      return arr
    },
  },
  created() {},
  mounted() {},
}
</script>

<style scoped lang="scss">
.GeneralDoc {
  // background: red;
  // height: 700px;
  // max-height: 1000px;
  width: 100%;
}
</style>
